package com.cw.DesignModel23.Behavioral.VisitorPattern.Visitor2;

//【接受访问的具体类：File（ConcreteElement角色）】
public class File extends EntryElement {
    private String name;
    private int size;

    public File(String name, int size) {
        this.name = name;
        this.size = size;
    }

    public String getName() {
        return name;
    }

    public int getSize() {
        return size;
    }

    public void accept(Visitor v) {
        // 把自己交给访问者访问
        v.visit(this);
    }
}

